package com.eece496.Server;
import java.sql.*;
import java.io.IOException;
import java.sql.DriverManager;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class MasterServlet
 */
public class MasterServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
	protected static java.sql.Connection connection = null;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public MasterServlet() {
        super();
        // TODO Auto-generated constructor stub
    }

    public static void Connect()
	{
    	String connectionString = "jdbc:mysql://localhost/groupassessments?user=bluebear&password=bluebeariscute89";
		try
        {
            // Ensure the SQL Server driver class is available.
            Class.forName("com.mysql.jdbc.Driver");

            // Establish the connection.
            connection = DriverManager.getConnection(connectionString);
        }
        // Exception handling
        catch (ClassNotFoundException cnfe)  
        {

            System.out.println("ClassNotFoundException " +
                               cnfe.getMessage());
        }
        catch (Exception e)
        {
            System.out.println("Exception " + e.getMessage());
            e.printStackTrace();
        }
	}

}
